package com.menhai.personmanagement.controller;

import lombok.extern.slf4j.Slf4j;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.menhai.personmanagement.services.ITjProposalService;
import com.menhai.personmanagement.entity.TjProposal;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author shikun
 * @since 2022-01-17
 */

@Slf4j
@RestController
@RequestMapping("/tj-proposal")
public class TjProposalController {

     @Autowired
     private ITjProposalService tjProposalService;


     @RequestMapping("/addProposal")
     public int addProposal(TjProposal tjProposal, @RequestHeader("level") String hosnum,@RequestHeader("userid") int userid){
          return tjProposalService.addProposal(tjProposal,hosnum,userid);
     }

     @RequestMapping("/allProposal")
     public List allProposal(){
          return tjProposalService.allProposal();
     }

     @RequestMapping("/editProposal")
     public int editProposal(TjProposal tjProposal){
          return tjProposalService.editProposal(tjProposal);
     }

     @RequestMapping("/delProposal")
     public int delProposal(TjProposal tjProposal){
          return tjProposalService.delProposal(tjProposal);
     }
}
